package com.norman.sorry.core.tiles;

import com.norman.sorry.core.pieces.IPiece;

/**
 * Represents a tile on the game board that a game piece can occupy. This
 * interface requires a few basic methods that are critical to the game.
 * 
 * @author Brian Norman
 * @version 0.0.1 beta
 * @since 0.0.1 beta
 */
public interface ITile {

   /**
    * Sets the game piece at this tile and returns the game piece that was at
    * this tile. If no game piece was at this tile, returns <code>null</code>.
    * 
    * @param piece
    *           the new game piece at this tile.
    * @return the game piece that was at this tile.
    */
   public IPiece setPiece(IPiece piece);

   /**
    * Returns the game piece at this tile.
    * 
    * @return the game piece at this tile.
    */
   public IPiece getPiece();

   /**
    * Returns if the tile has a game piece on it.
    * 
    * @return if the tile has a game piece on it.
    */
   public boolean containsPiece();

   /**
    * Returns if the game piece is at the starting position.
    * 
    * @return if the game piece is at the starting position.
    * @see com.norman.sorry.core.tiles.ITile#isStart()
    */
   public boolean isStart();

   /**
    * Returns if the game piece is in the safe zone.
    * 
    * @return if the game piece is in the safe zone.
    * @see com.norman.sorry.core.tiles.ITile#isSafe()
    */
   public boolean isSafe();

   /**
    * Returns if the game piece is at the home position.
    * 
    * @return if the game piece is at the home position.
    */
   public boolean isHome();

}
